[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
LimitNOFILE={{ ngx_arg.ulimit_nofile }}
LimitNPROC={{ ngx_arg.ulimit_nproc }}
LimitCORE=infinity
LimitMEMLOCK=infinity
Type=forking
PIDFile=/var/run/nginx.pid
ExecStart=/usr/sbin/nginx -c {{ ngx_conf_path }}/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID

[Install]
WantedBy=multi-user.target
